/*
 * johnson
 *
 */

package com.lxd.pattern.singleton.regiester;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class RegisterMap {
    public RegisterMap() {
    }

    private static Map<String,Object> register = new ConcurrentHashMap<String, Object>();

    public static RegisterMap getInstance(String name){

        if(null == name){
            name = RegisterMap.class.getName();
        }

        if(register.get(name) == null){
            try {

            register.put(name, new RegisterMap());
            }catch (Exception e){
                e.printStackTrace();
            }
        }

        return (RegisterMap)register.get(name);
    }
}
